#pragma once

// MeltingBase.h
///////////////////////////

#if defined( WIN32 )

	#define WIN32_LEAN_AND_MEAN		// do not include unnecessary headers
	#include <windows.h>

#endif 

// TYPES
typedef  unsigned char		UBYTE;
typedef    signed char		SBYTE;

typedef unsigned short		UWORD;
typedef   signed short		SWORD;

typedef unsigned  long		ULONG;
typedef   signed  long		SLONG;

typedef float				FLOAT;

typedef		unsigned char	UINT8;
typedef		unsigned short	UINT16;
typedef		unsigned int	UINT32;	 
 
typedef		signed char		INT8;
typedef		signed short	INT16;
typedef		signed int		INT32;

const ULONG FS_FILE_NAME_MAX = 127;

#define String		std::string
#define List		std::list 

#ifndef		nullptr
#	define nullptr		NULL
#endif 

#define SAFE_DELETE(x)				if((x)) { delete (x); (x) = nullptr; }
#define SAFE_DELETE_ARRAY(x) 		if((x)) { delete [](x); (x) = nullptr; }

#define FIND_STRING(_strExpected,_strToTest)					strstr( (_strExpected), (_strToTest) )
#define MATCH_STRING(_strExpected,_strToTest)					(0 == strcmp( (_strExpected), (_strToTest) ))
#define MATCH_STRING_SIZED(_strExpected,_strToTest,_iLen)		(0 == _strnicmp( (_strExpected), (_strToTest), (_iLen) ))
#define MATCH_STRING_START(_strExpectedStart,_strToTest)		(0 == _strnicmp( (_strExpectedStart), (_strToTest), strlen(_strExpectedStart) ))
#define MATCH_STATIC_STRING_START(_strExpectedStart,_strToTest)	(0 == _strnicmp( (_strExpectedStart), (_strToTest), sizeof(_strExpectedStart) - 1 ))


#define ACTIVATE_LOG_RESOURCE 1

//-------------------------------------------------
#if ACTIVATE_LOG_RESOURCE
#	define LOG_RESOURCE(...)		LOG(__VA_ARGS__)
#else
#	define LOG_RESOURCE(...)			
#endif
//-------------------------------------------------

#include <string>
#include <sstream>
#include <vector>
#include <list>
#include <map>
#include <algorithm>
#include <stdarg.h>
#include <stdio.h>

#include "Debug/Log.h"
#include "Debug/Assert.h"
#include "Debug/UnitTest.h" 

#include "Memory/MemoryParser.h" 

#include "Resource/File.h" 
#include "Resource/PackFile.h"  
#include "Resource/ResourceInstance.h" 
#include "Resource/Resource.h" 
#include "Resource/ResourceManager.h" 

#include "Tools/Allocator.h" 
#include "Tools/Array.h" 
#include "Tools/BitField.h" 
#include "Tools/ScriptParser.h"  
#include "Tools/RadixSort.h" 
#include "Tools/Timer.h" 